.class public Lcom/qq/e/ads/nativ/NativeUnifiedAD;
.super Lcom/qq/e/ads/AbstractAD;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/qq/e/ads/nativ/NativeUnifiedAD$AdListenerAdapter;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/qq/e/ads/AbstractAD<",
        "Lcom/qq/e/comm/pi/NUADI;",
        ">;"
    }
.end annotation


# instance fields
.field private f:Lcom/qq/e/ads/nativ/NativeUnifiedAD$AdListenerAdapter;

.field private g:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private h:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private i:Ljava/lang/String;

.field private volatile j:I

.field private k:I

.field private l:I


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/qq/e/ads/nativ/NativeADUnifiedListener;)V
    .locals 2

    invoke-direct {p0}, Lcom/qq/e/ads/AbstractAD;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->g:Ljava/util/List;

    const/4 v0, 0x0

    iput v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->k:I

    iput v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->l:I

    if-eqz p1, :cond_1

    invoke-static {p2}, Lcom/qq/e/comm/util/StringUtil;->isEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_1

    invoke-static {p3}, Lcom/qq/e/comm/util/StringUtil;->isEmpty(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    goto :goto_0

    :cond_0
    new-instance v0, Lcom/qq/e/ads/nativ/NativeUnifiedAD$AdListenerAdapter;

    invoke-direct {v0, p4}, Lcom/qq/e/ads/nativ/NativeUnifiedAD$AdListenerAdapter;-><init>(Lcom/qq/e/ads/nativ/NativeADUnifiedListener;)V

    iput-object v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->f:Lcom/qq/e/ads/nativ/NativeUnifiedAD$AdListenerAdapter;

    iput-object p3, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->i:Ljava/lang/String;

    invoke-virtual {p0, p1, p2, p3, p4}, Lcom/qq/e/ads/AbstractAD;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/qq/e/ads/AbstractAD$BasicADListener;)V

    return-void

    :cond_1
    :goto_0
    const/4 v1, 0x3

    new-array v1, v1, [Ljava/lang/Object;

    aput-object p2, v1, v0

    const/4 p2, 0x1

    aput-object p3, v1, p2

    const/4 p2, 0x2

    aput-object p1, v1, p2

    const-string p1, "NativeUnifiedAD constructor parameters error, appId=%s, posId=%s, context=%s"

    invoke-static {p1, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Lcom/qq/e/comm/util/GDTLogger;->e(Ljava/lang/String;)V

    const/16 p1, 0xfa2

    invoke-virtual {p0, p4, p1}, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->a(Lcom/qq/e/ads/AbstractAD$BasicADListener;I)V

    return-void
.end method

.method private a(IZ)V
    .locals 1

    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->c()Z

    move-result v0

    if-nez v0, :cond_0

    const-string p1, "Parameters or context error, details in init NativeUnifiedAD log"

    invoke-static {p1}, Lcom/qq/e/comm/util/GDTLogger;->e(Ljava/lang/String;)V

    return-void

    :cond_0
    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->b()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->a()Lcom/qq/e/comm/pi/ADI;

    move-result-object p2

    check-cast p2, Lcom/qq/e/comm/pi/NUADI;

    if-eqz p2, :cond_1

    invoke-interface {p2, p1}, Lcom/qq/e/comm/pi/NUADI;->loadData(I)V

    :cond_1
    return-void

    :cond_2
    if-eqz p2, :cond_3

    iget-object p2, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->g:Ljava/util/List;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-interface {p2, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_3
    return-void
.end method

.method static synthetic a(Lcom/qq/e/ads/nativ/NativeUnifiedAD;Lcom/qq/e/ads/AbstractAD$BasicADListener;I)V
    .locals 0

    invoke-super {p0, p1, p2}, Lcom/qq/e/ads/AbstractAD;->a(Lcom/qq/e/ads/AbstractAD$BasicADListener;I)V

    return-void
.end method


# virtual methods
.method protected final synthetic a(Landroid/content/Context;Lcom/qq/e/comm/pi/POFactory;Ljava/lang/String;Ljava/lang/String;)Lcom/qq/e/comm/pi/ADI;
    .locals 1

    iget-object v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->f:Lcom/qq/e/ads/nativ/NativeUnifiedAD$AdListenerAdapter;

    invoke-interface {p2, p1, p3, p4, v0}, Lcom/qq/e/comm/pi/POFactory;->getNativeAdManagerDelegate(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/qq/e/comm/adevent/ADListener;)Lcom/qq/e/comm/pi/NUADI;

    move-result-object p1

    return-object p1
.end method

.method protected final a(Lcom/qq/e/ads/AbstractAD$BasicADListener;I)V
    .locals 2

    new-instance v0, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    new-instance v1, Lcom/qq/e/ads/nativ/NativeUnifiedAD$1;

    invoke-direct {v1, p0, p1, p2}, Lcom/qq/e/ads/nativ/NativeUnifiedAD$1;-><init>(Lcom/qq/e/ads/nativ/NativeUnifiedAD;Lcom/qq/e/ads/AbstractAD$BasicADListener;I)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method protected final synthetic a(Lcom/qq/e/comm/pi/ADI;)V
    .locals 2

    check-cast p1, Lcom/qq/e/comm/pi/NUADI;

    iget v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->j:I

    invoke-interface {p1, v0}, Lcom/qq/e/comm/pi/NUADI;->setMaxVideoDuration(I)V

    iget v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->k:I

    invoke-interface {p1, v0}, Lcom/qq/e/comm/pi/NUADI;->setVideoPlayPolicy(I)V

    iget v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->l:I

    invoke-interface {p1, v0}, Lcom/qq/e/comm/pi/NUADI;->setVideoADContainerRender(I)V

    iget-object p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->h:Ljava/util/List;

    if-eqz p1, :cond_0

    invoke-virtual {p0, p1}, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->setCategories(Ljava/util/List;)V

    :cond_0
    iget-object p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->g:Ljava/util/List;

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    const/4 v1, 0x0

    invoke-direct {p0, v0, v1}, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->a(IZ)V

    goto :goto_0

    :cond_1
    return-void
.end method

.method public getAdNetWorkName()Ljava/lang/String;
    .locals 1

    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->a()Lcom/qq/e/comm/pi/ADI;

    move-result-object v0

    check-cast v0, Lcom/qq/e/comm/pi/NUADI;

    if-eqz v0, :cond_0

    invoke-interface {v0}, Lcom/qq/e/comm/pi/NUADI;->getAdNetWorkName()Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_0
    const-string v0, "The ad does not support \"getAdNetWorkName\" or you should call this method after \"onADLoaded\""

    invoke-static {v0}, Lcom/qq/e/comm/util/GDTLogger;->e(Ljava/lang/String;)V

    const/4 v0, 0x0

    return-object v0
.end method

.method public loadData(I)V
    .locals 1

    const/4 v0, 0x1

    invoke-direct {p0, p1, v0}, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->a(IZ)V

    iget p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->k:I

    if-nez p1, :cond_0

    const-string p1, "\u8bf7\u8c03\u7528setVideoPlayPolicy()\u63a5\u53e3\uff0c\u8bbe\u7f6e\u201c\u7528\u6237\u611f\u77e5\u7684\u89c6\u9891\u5e7f\u544a\u64ad\u653e\u7b56\u7565\u201d\uff0c\u6709\u52a9\u4e8e\u63d0\u9ad8\u89c6\u9891\u5e7f\u544a\u7684eCPM\u503c\uff1b\u5982\u679c\u5e7f\u544a\u4f4d\u4e0d\u652f\u6301\u89c6\u9891\u5e7f\u544a\uff0c\u8bf7\u5ffd\u7565\u672c\u63d0\u793a\u3002"

    invoke-static {p1}, Lcom/qq/e/comm/util/GDTLogger;->i(Ljava/lang/String;)V

    :cond_0
    iget p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->l:I

    if-nez p1, :cond_1

    const-string p1, "\u8bf7\u8c03\u7528setVideoADContainerRender()\u63a5\u53e3\uff0c\u8bbe\u7f6e\u201c\u7528\u6237\u9996\u6b21\u770b\u5230\u7684\u89c6\u9891\u5e7f\u544a\u5bb9\u5668\u201d\u6e32\u67d3\u7b56\u7565\uff0c\u6709\u52a9\u4e8e\u63d0\u9ad8\u89c6\u9891\u5e7f\u544a\u7684eCPM\u503c\uff1b\u5982\u679c\u5e7f\u544a\u4f4d\u4e0d\u652f\u6301\u89c6\u9891\u5e7f\u544a\uff0c\u8bf7\u5ffd\u7565\u672c\u63d0\u793a\u3002"

    invoke-static {p1}, Lcom/qq/e/comm/util/GDTLogger;->i(Ljava/lang/String;)V

    :cond_1
    return-void
.end method

.method public setCategories(Ljava/util/List;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    iput-object p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->h:Ljava/util/List;

    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->a()Lcom/qq/e/comm/pi/ADI;

    move-result-object v0

    check-cast v0, Lcom/qq/e/comm/pi/NUADI;

    if-eqz v0, :cond_0

    if-eqz p1, :cond_0

    invoke-interface {v0, p1}, Lcom/qq/e/comm/pi/NUADI;->setCategories(Ljava/util/List;)V

    :cond_0
    return-void
.end method

.method public setMaxVideoDuration(I)V
    .locals 1

    iput p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->j:I

    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->a()Lcom/qq/e/comm/pi/ADI;

    move-result-object p1

    check-cast p1, Lcom/qq/e/comm/pi/NUADI;

    if-eqz p1, :cond_0

    iget v0, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->j:I

    invoke-interface {p1, v0}, Lcom/qq/e/comm/pi/NUADI;->setMaxVideoDuration(I)V

    :cond_0
    return-void
.end method

.method public setTag(Ljava/util/Map;)V
    .locals 3

    if-eqz p1, :cond_0

    invoke-interface {p1}, Ljava/util/Map;->size()I

    move-result v0

    if-lez v0, :cond_0

    :try_start_0
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/util/Map;)V

    invoke-static {}, Lcom/qq/e/comm/managers/GDTADManager;->getInstance()Lcom/qq/e/comm/managers/GDTADManager;

    move-result-object p1

    invoke-virtual {p1}, Lcom/qq/e/comm/managers/GDTADManager;->getSM()Lcom/qq/e/comm/managers/setting/SM;

    move-result-object p1

    const-string v1, "ad_tags"

    iget-object v2, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->i:Ljava/lang/String;

    invoke-virtual {p1, v1, v0, v2}, Lcom/qq/e/comm/managers/setting/SM;->setDEVCodeSetting(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-void

    :catch_0
    move-exception p1

    const-string v0, "NativeUnifiedAD#setTag Exception"

    invoke-static {v0}, Lcom/qq/e/comm/util/GDTLogger;->e(Ljava/lang/String;)V

    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_0
    return-void
.end method

.method public setVideoADContainerRender(I)V
    .locals 1

    const/4 v0, 0x1

    if-eq p1, v0, :cond_0

    const/4 v0, 0x2

    if-eq p1, v0, :cond_0

    const-string p1, "videoADContainerRender\u53c2\u6570\u6709\u8bef\uff0c\u53ea\u80fd\u662fVideoADContainerRender.SDK \u6216 VideoADContainerRender.DEV"

    invoke-static {p1}, Lcom/qq/e/comm/util/GDTLogger;->e(Ljava/lang/String;)V

    return-void

    :cond_0
    iput p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->l:I

    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->a()Lcom/qq/e/comm/pi/ADI;

    move-result-object v0

    check-cast v0, Lcom/qq/e/comm/pi/NUADI;

    if-eqz v0, :cond_1

    invoke-interface {v0, p1}, Lcom/qq/e/comm/pi/NUADI;->setVideoADContainerRender(I)V

    :cond_1
    return-void
.end method

.method public setVideoPlayPolicy(I)V
    .locals 1

    const/4 v0, 0x1

    if-eq p1, v0, :cond_0

    const/4 v0, 0x2

    if-eq p1, v0, :cond_0

    const-string p1, "videoPlayPolicy\u53c2\u6570\u6709\u8bef\uff0c\u53ea\u80fd\u662fVideoPlayPolicy.AUTO \u6216 VideoPlayPolicy.MANUAL"

    invoke-static {p1}, Lcom/qq/e/comm/util/GDTLogger;->e(Ljava/lang/String;)V

    return-void

    :cond_0
    iput p1, p0, Lcom/qq/e/ads/nativ/NativeUnifiedAD;->k:I

    invoke-virtual {p0}, Lcom/qq/e/ads/AbstractAD;->a()Lcom/qq/e/comm/pi/ADI;

    move-result-object v0

    check-cast v0, Lcom/qq/e/comm/pi/NUADI;

    if-eqz v0, :cond_1

    invoke-interface {v0, p1}, Lcom/qq/e/comm/pi/NUADI;->setVideoPlayPolicy(I)V

    :cond_1
    return-void
.end method
